package org.jeecg.modules.online.cgform.utils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
import org.jeecgframework.poi.handler.impl.ExcelDataHandlerDefaultImpl;
import org.jeecgframework.poi.util.PoiPublicUtil;

/* renamed from: org.jeecg.modules.online.cgform.d.b */
/* loaded from: hibernate-re-3.7.1-RC.jar:org/jeecg/modules/online/cgform/d/b.class */
public class CgFormExcelHandler extends ExcelDataHandlerDefaultImpl {

    /* renamed from: a */
    Map<String, OnlCgformField> f197a;

    /* renamed from: c */
    String f199c;

    /* renamed from: e */
    String f201e;

    /* renamed from: d */
    String f200d = "online";

    /* renamed from: b */
    ISysBaseAPI f198b = (ISysBaseAPI) SpringContextUtils.getBean(ISysBaseAPI.class);

    public CgFormExcelHandler(List<OnlCgformField> list, String str, String str2) {
        this.f197a = m386a(list);
        this.f199c = str;
        this.f201e = str2;
    }

    /* renamed from: a */
    private Map<String, OnlCgformField> m386a(List<OnlCgformField> list) {
        HashMap hashMap = new HashMap();
        for (OnlCgformField onlCgformField : list) {
            hashMap.put(onlCgformField.getDbFieldTxt(), onlCgformField);
        }
        return hashMap;
    }

    public void setMapValue(Map<String, Object> map, String originKey, Object value) {
        String m387a = m387a(originKey);
        if (value instanceof Double) {
            map.put(m387a, PoiPublicUtil.doubleToString((Double) value));
        } else if (value instanceof byte[]) {
            String m346a = CgformUtil.m346a((byte[]) value, this.f199c, this.f200d, this.f201e);
            if (m346a != null) {
                map.put(m387a, m346a);
            }
        } else {
            map.put(m387a, value == null ? "" : value.toString());
        }
    }

    /* renamed from: a */
    private String m387a(String str) {
        if (this.f197a.containsKey(str)) {
            return "$mainTable$" + this.f197a.get(str).getDbFieldName();
        }
        return "$subTable$" + str;
    }
}
